package com.fable.biz.operate.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 客户来源 推广-1,线下-2、贝德-3、凯粤-4、中凡-5、捷信-6、金通-7、普瑞益思-8、科烨-9、优知睿-10、其他-11
 * Created by weishuai on 15/7/31.
 */
public enum ResourceEnum {

    tuiguang("推广", 1),
    xianxia("线下", 2),
    beide("贝德", 3),
    kaiyue("凯粤", 4),
    zhongfan("中凡", 5),
    jiexin("捷信", 6),
    jintong("金通", 7),
    puruiyisi("普瑞益思", 8),
    keye("科烨", 9),
    youzhirui("优知睿", 10),
    juzhida("聚智达", 12),
    jihe("稷合", 13),
    hongchuang("宏创", 14),
    qita("其他", 11),
    ;

    private String desc;
    private Integer status;

    ResourceEnum(String desc, Integer status) {
        this.desc = desc;
        this.status = status;
    }

    public String getDesc() {
        return desc;
    }

    public Integer getStatus() {
        return status;
    }

    public static ResourceEnum valueOf(Integer value) {
        switch (value) {
            case 1:
                return tuiguang;
            case 2:
                return xianxia;
            case 3:
                return beide;
            case 4:
                return kaiyue;
            case 5:
                return zhongfan;
            case 6:
                return jiexin;
            case 7:
                return jintong;
            case 8:
                return puruiyisi;
            case 9:
                return keye;
            case 10:
                return youzhirui;
            case 11:
                return qita;
            default:
                return null;
        }
    }


    public static Map<Integer, String> getMap() {
        Map<Integer, String> map = new HashMap<Integer, String>(values().length);
        for (ResourceEnum client : values()) {
            map.put(client.getStatus(), client.getDesc());
        }
        return map;
    }

}
